<style tyle="text/css">
  .modal-lg {
      width: 60%;
  }
</style>
<div class="modal-header">
  <h4 class="modal-title">{{activity.title}}（出游时间：{{activity.tour_date}}）</h4>
</div>
<div class="modal-body">
  <div class="panel-body">
    <div class="col-lg-6">
      <div class="input-group" >
        <div class="input-group-btn">
          <span class="btn btn-default">机构名称</span>
        </div>
        <ui-select ng-model="formData.company" theme="bootstrap">
          <ui-select-match placeholder="选择..">{{$select.selected.name}}</ui-select-match>
          <ui-select-choices repeat="item in company_list | filter: $select.search | filter: {'show': true}">
            <span ng-bind-html="item.name | highlight: $select.search"></span>
          </ui-select-choices>
        </ui-select>
      </div>
    </div>
    <div class="col-lg-4">
      <div class="input-group">
        <input type="number" class="form-control" ng-model="formData.num" placeholder="分配名额">
        <span class="input-group-addon">人</span>
      </div>
    </div>
    <div class="col-lg-2">
      <button class="btn btn-success" ng-click="add()">添加</button>
    </div>
  </div>
  

  <table class="table table-striped table-bordered">
    <thead>
      <tr>
        <th style="width: 13%; text-align: center">名称</th>
        <th style="width: 13%; text-align: center">编号</th>
        <th style="width: 13%; text-align: center">出游日期</th>
        <th style="width: 10%; text-align: center">名额(人)</th>
        <th style="width: 10%; text-align: center">剩余名额(人)</th>
        <th style="width: 10%; text-align: center"></th>
      </tr>
    </thead>
    <tbody>
      <tr ng-repeat="info in list" style="height: 51px">
        <td style="vertical-align: middle;">{{info.company_name}}</td>
        <td class="text-center" style="vertical-align: middle;">{{info.company_code}}</td>
        <td class="text-center" style="vertical-align: middle;">{{info.tour_date}}</td>
        <td class="text-center" style="vertical-align: middle;">
          <span ng-show="!info.update">{{info.all_stock}}</span>
          <input type="number" ng-show="info.update" class="form-control" ng-model="info.all_stock">
        </td>
        <td class="text-center" style="vertical-align: middle;">{{info.surplus_stock}}</td>
        <td class="text-center" style="vertical-align: middle;">
          <button type="button" class="btn btn-info btn-xs" ng-show="!info.update" ng-click="update(info)">编辑</button>
          <button type="button" class="btn btn-success btn-xs" ng-show="info.update" ng-click="save(info)">保存</button>
          <button type="button" class="btn btn-danger btn-xs" ng-click="delete(info, $index)">删除</button>
        </td>
      </tr>
    </tbody>
  </table>

</div>
<div class="modal-footer">
  <button class="btn btn-danger" type="button" ng-click="close()">关闭</button>
</div>